package cn.iocoder.yudao.module.pay.splitting.service.admin;

import cn.iocoder.yudao.framework.business.basic.dao.query.CoreQueryWrapper;
import cn.iocoder.yudao.framework.business.basic.service.PageService;
import cn.iocoder.yudao.framework.business.basic.service.impl.BaseService;
import cn.iocoder.yudao.module.pay.splitting.dao.SplittingMerchantMapper;
import cn.iocoder.yudao.module.pay.splitting.pojo.dto.SplittingMerchantQueryDTO;
import cn.iocoder.yudao.module.pay.splitting.pojo.po.SplittingMerchant;
import cn.iocoder.yudao.module.pay.splitting.pojo.vo.SplittingMerchantVO;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 服务
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/05/17
 */
@Service
public class SplittingMerchantService extends BaseService<SplittingMerchant, SplittingMerchantVO, SplittingMerchantQueryDTO> implements PageService<SplittingMerchantVO, SplittingMerchantQueryDTO> {
    @Resource
    private SplittingMerchantMapper splittingMerchantMapper;

    @Override
    public SplittingMerchantMapper getInjectedMapper() {
        return splittingMerchantMapper;
    }

    @Nonnull
    @Override
    protected CoreQueryWrapper<SplittingMerchant> buildQueryWrapper(SplittingMerchantQueryDTO param) {
        CoreQueryWrapper<SplittingMerchant> wrapper = super.buildQueryWrapper(param);
        wrapper.eqIfPresent("status", param.getStatus());
        wrapper.likeIfPresent("name", param.getName());
        wrapper.likeIfPresent("phone", param.getPhone());
        return wrapper;
    }

}
